<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1999-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Debugging Options (The GNU Fortran Compiler)</title>

<meta name="description" content="Debugging Options (The GNU Fortran Compiler)">
<meta name="keywords" content="Debugging Options (The GNU Fortran Compiler)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Invoking-GNU-Fortran.html" rel="up" title="Invoking GNU Fortran">
<link href="Directory-Options.html" rel="next" title="Directory Options">
<link href="Error-and-Warning-Options.html" rel="prev" title="Error and Warning Options">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<span id="Debugging-Options"></span><div class="header">
<p>
Next: <a href="Directory-Options.html" accesskey="n" rel="next">Directory Options</a>, Previous: <a href="Error-and-Warning-Options.html" accesskey="p" rel="prev">Error and Warning Options</a>, Up: <a href="Invoking-GNU-Fortran.html" accesskey="u" rel="up">Invoking GNU Fortran</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="Options-for-debugging-your-program-or-GNU-Fortran"></span><h3 class="section">2.5 Options for debugging your program or GNU Fortran</h3>
<span id="index-options_002c-debugging"></span>
<span id="index-debugging-information-options"></span>

<p>GNU Fortran has various special options that are used for debugging
either your program or the GNU Fortran compiler.
</p>
<dl compact="compact">
<dd><span id="index-fdump_002dfortran_002doriginal"></span>
</dd>
<dt><code>-fdump-fortran-original</code></dt>
<dd><p>Output the internal parse tree after translating the source program
into internal representation.  This option is mostly useful for
debugging the GNU Fortran compiler itself. The output generated by
this option might change between releases. This option may also
generate internal compiler errors for features which have only
recently been added.
</p>
<span id="index-fdump_002dfortran_002doptimized"></span>
</dd>
<dt><code>-fdump-fortran-optimized</code></dt>
<dd><p>Output the parse tree after front-end optimization.  Mostly useful for
debugging the GNU Fortran compiler itself. The output generated by
this option might change between releases.  This option may also
generate internal compiler errors for features which have only
recently been added.
</p>
<span id="index-fdump_002dparse_002dtree"></span>
</dd>
<dt><code>-fdump-parse-tree</code></dt>
<dd><p>Output the internal parse tree after translating the source program
into internal representation.  Mostly useful for debugging the GNU
Fortran compiler itself. The output generated by this option might
change between releases. This option may also generate internal
compiler errors for features which have only recently been added. This
option is deprecated; use <code>-fdump-fortran-original</code> instead.
</p>
<span id="index-fdebug_002daux_002dvars"></span>
</dd>
<dt><code>-fdebug-aux-vars</code></dt>
<dd><p>Renames internal variables created by the gfortran front end and makes
them accessible to a debugger.  The name of the internal variables then
start with upper-case letters followed by an underscore.  This option is
useful for debugging the compiler&rsquo;s code generation together with
<code>-fdump-tree-original</code> and enabling debugging of the executable
program by using <code>-g</code> or <code>-ggdb3</code>.
</p>
<span id="index-fdump_002dfortran_002dglobal"></span>
</dd>
<dt><code>-fdump-fortran-global</code></dt>
<dd><p>Output a list of the global identifiers after translating into
middle-end representation. Mostly useful for debugging the GNU Fortran
compiler itself. The output generated by this option might change
between releases.  This option may also generate internal compiler
errors for features which have only recently been added.
</p>
<span id="index-ffpe_002dtrap_003dlist"></span>
</dd>
<dt><code>-ffpe-trap=<var>list</var></code></dt>
<dd><p>Specify a list of floating point exception traps to enable.  On most
systems, if a floating point exception occurs and the trap for that
exception is enabled, a SIGFPE signal will be sent and the program
being aborted, producing a core file useful for debugging.  <var>list</var>
is a (possibly empty) comma-separated list of the following
exceptions: &lsquo;<samp>invalid</samp>&rsquo; (invalid floating point operation, such as
<code>SQRT(-1.0)</code>), &lsquo;<samp>zero</samp>&rsquo; (division by zero), &lsquo;<samp>overflow</samp>&rsquo;
(overflow in a floating point operation), &lsquo;<samp>underflow</samp>&rsquo; (underflow
in a floating point operation), &lsquo;<samp>inexact</samp>&rsquo; (loss of precision
during operation), and &lsquo;<samp>denormal</samp>&rsquo; (operation performed on a
denormal value).  The first five exceptions correspond to the five
IEEE 754 exceptions, whereas the last one (&lsquo;<samp>denormal</samp>&rsquo;) is not
part of the IEEE 754 standard but is available on some common
architectures such as x86.
</p>
<p>The first three exceptions (&lsquo;<samp>invalid</samp>&rsquo;, &lsquo;<samp>zero</samp>&rsquo;, and
&lsquo;<samp>overflow</samp>&rsquo;) often indicate serious errors, and unless the program
has provisions for dealing with these exceptions, enabling traps for
these three exceptions is probably a good idea.
</p>
<p>If the option is used more than once in the command line, the lists will
be joined: &rsquo;<code>ffpe-trap=</code><var>list1</var> <code>ffpe-trap=</code><var>list2</var>&rsquo;
is equivalent to <code>ffpe-trap=</code><var>list1</var>,<var>list2</var>.
</p>
<p>Note that once enabled an exception cannot be disabled (no negative form).
</p>
<p>Many, if not most, floating point operations incur loss of precision
due to rounding, and hence the <code>ffpe-trap=inexact</code> is likely to
be uninteresting in practice.
</p>
<p>By default no exception traps are enabled.
</p>
<span id="index-ffpe_002dsummary_003dlist"></span>
</dd>
<dt><code>-ffpe-summary=<var>list</var></code></dt>
<dd><p>Specify a list of floating-point exceptions, whose flag status is printed
to <code>ERROR_UNIT</code> when invoking <code>STOP</code> and <code>ERROR STOP</code>.
<var>list</var> can be either &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>all</samp>&rsquo; or a comma-separated list
of the following exceptions: &lsquo;<samp>invalid</samp>&rsquo;, &lsquo;<samp>zero</samp>&rsquo;, &lsquo;<samp>overflow</samp>&rsquo;,
&lsquo;<samp>underflow</samp>&rsquo;, &lsquo;<samp>inexact</samp>&rsquo; and &lsquo;<samp>denormal</samp>&rsquo;. (See
<samp>-ffpe-trap</samp> for a description of the exceptions.)
</p>
<p>If the option is used more than once in the command line, only the
last one will be used.
</p>
<p>By default, a summary for all exceptions but &lsquo;<samp>inexact</samp>&rsquo; is shown.
</p>
<span id="index-fno_002dbacktrace"></span>
<span id="index-backtrace"></span>
<span id="index-trace"></span>
</dd>
<dt><code>-fno-backtrace</code></dt>
<dd><p>When a serious runtime error is encountered or a deadly signal is
emitted (segmentation fault, illegal instruction, bus error,
floating-point exception, and the other POSIX signals that have the
action &lsquo;<samp>core</samp>&rsquo;), the Fortran runtime library tries to output a
backtrace of the error. <code>-fno-backtrace</code> disables the backtrace
generation. This option only has influence for compilation of the
Fortran main program.
</p>
</dd>
</dl>

<p>See <a href="https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-Options">Options for Debugging Your Program or GCC</a> in <cite>Using the GNU Compiler Collection (GCC)</cite>, for more information on
debugging options.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Directory-Options.html" accesskey="n" rel="next">Directory Options</a>, Previous: <a href="Error-and-Warning-Options.html" accesskey="p" rel="prev">Error and Warning Options</a>, Up: <a href="Invoking-GNU-Fortran.html" accesskey="u" rel="up">Invoking GNU Fortran</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
